<?php

include("mysqlconfig.inc");
if (isset($_POST['queryString'])) {
    $queryString = $_POST['queryString'];
    if (strlen($queryString) > 0) {
        $query = mysql_query("SELECT nome FROM EMPRESAS WHERE nome LIKE '$queryString%' LIMIT 10") or die("Erro na consulta");
        while ($result = mysql_fetch_array($query)) {
            echo '<li onClick="fill(\'' . $result[0] . '\');">' . $result[0] . '</li>';
        }
    }
}
?>
